home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / common1a / form1.frm next >
Text File  |  1999-09-19  |  4KB  |  144 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Dialogs"
  5.    ClientHeight    =   3555
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   2205
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   3555
  13.    ScaleWidth      =   2205
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.CommandButton Command3 
  16.       Caption         =   "Show Font"
  17.       Height          =   495
  18.       Left            =   120
  19.       TabIndex        =   4
  20.       Top             =   1440
  21.       Width           =   1935
  22.    End
  23.    Begin VB.CommandButton Command5 
  24.       Caption         =   "Show Color"
  25.       Height          =   495
  26.       Left            =   120
  27.       TabIndex        =   3
  28.       Top             =   2640
  29.       Width           =   1935
  30.    End
  31.    Begin VB.CommandButton Command4 
  32.       Caption         =   "Show Printer"
  33.       Height          =   495
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   2040
  37.       Width           =   1935
  38.    End
  39.    Begin VB.CommandButton Command2 
  40.       Caption         =   "Show Save"
  41.       Height          =   495
  42.       Left            =   120
  43.       TabIndex        =   1
  44.       Top             =   840
  45.       Width           =   1935
  46.    End
  47.    Begin VB.CommandButton Command1 
  48.       Caption         =   "Show Open"
  49.       Height          =   495
  50.       Left            =   120
  51.       TabIndex        =   0
  52.       Top             =   240
  53.       Width           =   1935
  54.    End
  55. End
  56. Attribute VB_Name = "Form1"
  57. Attribute VB_GlobalNameSpace = False
  58. Attribute VB_Creatable = False
  59. Attribute VB_PredeclaredId = True
  60. Attribute VB_Exposed = False
  61. Option Explicit
  62. Private Sub Command1_Click()
  63. Dim sOpen As SelectedFile
  64. Dim Count As Integer
  65. Dim FileList As String
  66.  
  67.     On Error GoTo e_Trap
  68.     
  69.     FileDialog.sFilter = "Text Files (*.txt)" & Chr$(0) & "*.sky" & Chr$(0) & "All Files (*.*)" & Chr$(0) & "*.*"
  70.     
  71.     ' See Standard CommonDialog Flags for all options
  72.     FileDialog.flags = OFN_EXPLORER Or OFN_LONGNAMES Or OFN_HIDEREADONLY Or OFN_ALLOWMULTISELECT
  73.     FileDialog.sDlgTitle = "Show Open"
  74.     FileDialog.sInitDir = App.Path & "\"
  75.     sOpen = ShowOpen(Me.hWnd)
  76.     If Err.Number <> 32755 And sOpen.bCanceled = False Then
  77.         FileList = "Directory : " & sOpen.sLastDirectory & vbCr
  78.         For Count = 1 To sOpen.nFilesSelected
  79.             FileList = FileList & sOpen.sFiles(Count) & vbCr
  80.         Next Count
  81.         Call MsgBox(FileList, vbOKOnly + vbInformation, "Show Open Selected")
  82.     End If
  83.     Exit Sub
  84. e_Trap:
  85.     Exit Sub
  86.     Resume
  87.  
  88. End Sub
  89.  
  90. Private Sub Command2_Click()
  91. Dim sSave As SelectedFile
  92. Dim Count As Integer
  93. Dim FileList As String
  94.  
  95.     On Error GoTo e_Trap
  96.     
  97.     FileDialog.sFilter = "Text Files (*.txt)" & Chr$(0) & "*.sky" & Chr$(0) & "All Files (*.*)" & Chr$(0) & "*.*"
  98.     
  99.     ' See Standard CommonDialog Flags for all options
  100.     FileDialog.flags = OFN_HIDEREADONLY
  101.     FileDialog.sDlgTitle = "Show Save"
  102.     FileDialog.sInitDir = App.Path & "\"
  103.     sSave = ShowSave(Me.hWnd)
  104.     If Err.Number <> 32755 And sSave.bCanceled = False Then
  105.         FileList = "Directory : " & sSave.sLastDirectory & vbCr
  106.         For Count = 1 To sSave.nFilesSelected
  107.             FileList = FileList & sSave.sFiles(Count) & vbCr
  108.         Next Count
  109.         Call MsgBox(FileList, vbOKOnly + vbInformation, "Show Save Selected")
  110.     End If
  111.     Exit Sub
  112. e_Trap:
  113.     Exit Sub
  114.     Resume
  115.  
  116. End Sub
  117.  
  118. Private Sub Command3_Click()
  119. Dim sFont As SelectedFont
  120.     On Error GoTo e_Trap
  121.     FontDialog.iPointSize = 12 * 10
  122.     sFont = ShowFont(Me.hWnd, "Times New Roman")
  123.     Exit Sub
  124. e_Trap:
  125.     Exit Sub
  126. End Sub
  127.  
  128. Private Sub Command4_Click()
  129.     On Error GoTo e_Trap
  130.     Call ShowPrinter(Me.hWnd)
  131.     Exit Sub
  132. e_Trap:
  133.     Exit Sub
  134. End Sub
  135.  
  136. Private Sub Command5_Click()
  137. Dim sColor As SelectedColor
  138.     On Error GoTo e_Trap
  139.     sColor = ShowColor(Me.hWnd)
  140.     Exit Sub
  141. e_Trap:
  142.     Exit Sub
  143. End Sub
  144.